package com.itheima.io.objectoutputstream.demo01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ObjectInputStreamDemo01 {

    public static void main(String[] args) throws IOException, ClassNotFoundException {

        ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream("itheima-io-objectoutputstream\\obj.txt"));

        Student student =(Student) objectInputStream.readObject();

        System.out.println(student.getName() + "----" + student.getAge());

        objectInputStream.close();

    }

}
